/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.iubar.tkdscore;

import java.awt.Color;
import java.awt.Shape;
import java.awt.geom.Arc2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

/**
 *
 * @author borgo
 */
public class Utils {

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        // draw Rectangle2D.Double
        int x = 100;
        int y = 100;
        int rectwidth = 200;
        int rectheight = 200;
        g2.draw(new Rectangle2D.Double(x, y, rectwidth, rectheight));
    }

    public void paint2(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);

        g2.setPaint(Color.gray);
        int x = 5;
        int y = 7;

        g2.setPaint(Color.red);
        g2.fill(new Rectangle2D.Double(x, y, 200, 200));
        g2.setPaint(Color.black);
        g2.drawString("Filled Rectangle2D", x, 250);
    }

    public void dummy() {
        int x1 = 1, x2 = 2, w = 3, h = 4, x = 5, y = 6, y1 = 1, y2 = 2, start = 3;
        Shape line = new Line2D.Float(x1, y1, x2, y2);
        Shape arc = new Arc2D.Float(x, y, w, h, start, 1, 1);
        Shape oval = new Ellipse2D.Float(x, y, w, h);
        Shape rectangle = new Rectangle2D.Float(x, y, w, h);
        Shape roundRectangle = new RoundRectangle2D.Float(x, y, w, h, 1, 2);
    }
    
} // end class

/*
Shape

    * Line
    * Rectangle
    * (rounded)
    * Ellipse
    * Arc
    * Polygon

awt

    * drawLine(x1,y1,x2,y2)
    * drawRect(x1,y1,x2,y2)
    * drawRoundRect(x1,y1,x2,y2,r1,r2)
    * drawOval(x,y,w,h)
    * drawArc(x,y,w,h,sdeg,ndeg)
    * drawPolygon(x[],y[],numPoints)

JFC 2D

    * Line2D.Float(x1,y1,x2,y2)
    * Rectangle2D.Float(x1,y1,x2,y2)
    * RoundedRectangle2D.Float(x1,y1,x2,y2)
    * Ellipse2D.Float(x,y,w,h)
    * Arc2D.Float(x,y,w,h,sdeg,ndeg,clos)
    *
*/